<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML>
<html>
	<head>
		<base href="<%=basePath%>">

		<title>增加试题功能</title>
		<link rel="stylesheet" type="text/css" href="<%=basePath%>css/bootstrap.css">
		<link rel="stylesheet" type="text/css" href="<%=basePath%>css/theme.css">

		<script src="<%=basePath%>js/jquery.js" type="text/javascript"></script>
	</head>

	<body class="content1">
		<script>
    		$('#a_leader_txt', parent.document).html('添加试题功能');
		</script>
		<div class="container-fluid">
			<div class="row-fluid">
				<div class="form-top-left">
					题型选择:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					<a data-type="0" href="javascript:void(0);" style="color: red;">选择题</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					&nbsp;&nbsp;&nbsp;
					<a data-type="1" href="javascript:void(0);">判断题</a><br>
					<br>
				</div>

				<form class="form-add" method="post" action="<%=basePath%>sys/subject?cmd=add">
					<div class="btn-toolbar">
						<input type="submit" class="btn btn-primary" value="保存">
						<a href="<%=basePath%>sys/subject?cmd=list" class="btn">取消</a>

					</div>
					<input type="hidden" class="type" name="type" value="0"/>
					<div class="well">
						<div class="tab-pane active in">
							<label>
								题干：
							</label>
							<input type="text" name="scontent" maxlength="100">
							
							<label>
								A选项内容：
							</label>
							<input type="text" name="sa" maxlength="100">
							<label>
								B选项内容：
							</label>
							<input type="text" name="sb" maxlength="100">
							<label>
								C选项内容：
							</label>
							<input type="text" name="sc" maxlength="100">
							<label>
								D选项内容：
							</label>
							<input type="text" name="sd" maxlength="100">
							<label>
								标准答案选项：
							</label>
							<input type="text" name="skey" maxlength="10">
							<label>
								试题状态：
							</label>
							<select name="sstate">
								<option value="1" selected>
									正常
								</option>
								<option value="0">
									锁定
								</option>
							</select>
							<label>答案解析：</label>
							<textarea rows="4" cols="50" name="answer"></textarea>
							<div style="color: red">
								${msg}
							</div>
						</div>
					</div>
				</form>
				<form class="form-add" method="post" action="<%=basePath%>sys/subject?cmd=add">
					<div class="btn-toolbar">
						<input type="submit" class="btn btn-primary" value="保存">
						<a href="<%=basePath%>sys/subject?cmd=list" class="btn">取消</a>

					</div>
					<input type="hidden" class="type" name="type" value="1"/>
					<div class="well">
						<div class="tab-pane active in">
							<label>
								题干：
							</label>
							<input type="text" name="scontent" maxlength="100">

							<label>
								标准答案：
							</label>
							<input type="text" name="skey" maxlength="10">
							<label>
								试题状态：
							</label>
							<select name="sstate">
								<option value="1" selected>
									正常
								</option>
								<option value="0">
									锁定
								</option>
							</select>
							<label>答案解析：</label>
							<textarea rows="4" cols="50" name="answer"></textarea>
							<div style="color: red">
								${msg}
							</div>
						</div>
					</div>
				</form>
			</div>
		</div>

<script type="text/javascript">
	var basePath = '<%=basePath%>';

	$(document).ready(function (){
		$('.form-top-left a').click(function () {
			$('.form-top-left').children().removeAttr("style");
			var type = $(this).css('color', 'red').attr("data-type");
			showSubject(type);
		});

		showSubject(0);
	});


	var showSubject = function (index) {
		$('.form-add').each(function ( _index) {
			if (index == _index) {
				$(this).css('display', 'block');
			}else {
				$(this).css('display', 'none');
			}
		});
	}
</script>
	</body>

</html>
